Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Stepped sine wave

64 views
Skip to first unread message

George Herold

unread,
Oct 13, 2011, 12:39:21 PM10/13/11
to
This is a continuation of the 50kHz VCO thread I started last week. I
tried the stepped sine wave idea as suggested by James A, and Phil
H.
The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at
frequency (F). The ten outputs from the 4017 are sent through
appropriate resistors and into the summing junction of an opamp.
Here’s a ‘scope shot of the stepped output overlaid with a sine
wave.

http://imageshack.us/photo/my-images/560/tek0024.png/

The resistor values were chosen to intersect the sine wave at each new
phase. (R(n) = 1/sin^2(n*18degrees))

Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k,
R4=R6=11k, R5=10k. all 1% resistors.


Here’s the spectrum as recorded by an SRS770 spectrum analyzer.

http://imageshack.us/photo/my-images/839/stepsin.png/

The 2nd harmonic is only down by 50dB. I don’t understand why it’s so
big. Is there some way to do better than this? The 9th and 11th
harmonics are big and then the 19th and 21st.

Thanks George H.

Jon Kirwan

unread,
Oct 13, 2011, 12:59:06 PM10/13/11
to

George, I don't remember the discussion. Probably didn't
read it. But if you are using a 4017 (decade counter), then
I'm guessing that you are enabling one resistor at a time
while disabling others (they tie to the summing junction from
each, moving output pin.) This worries me a little, mostly
because of delay and the fact that you are turning off one
while turning on another, but don't control that very well. I
also don't know what you are doing to filter the steps.

Anyway, I'd have wanted to consider, instead, a Gray-coded
(actually, the real inventor is Boudot, I think, but Bell
Labs was patenting everything in a flurry in the mid 1900's
and who could remember Boudot so long ago?) design where you
only change one of the outputs at a time. Not two.

Anyway, I'll let the big hitters who probably did read the
earlier thread tell you what is more likely. Just something
that crossed my mind, is all.

Jon

George Herold

unread,
Oct 13, 2011, 1:13:20 PM10/13/11
to
> Jon- Hide quoted text -
>
> - Show quoted text -

Hi Jon, Thanks for that. The 4017 is just too simple! I'm hoping all
the swithing transients can just be filtered away. I put a little
tweaker pot on the smallest R5 resistor and was able to get everything
down below 60dB, so I'm thinking this is just a resistor tolerance/
selection issue.
I was just twisting different resistors together to get the
approximate values, and didn't measure any of them. I'll try really
nailing the values I want.

Oh I'll add some multi-pole low pass on the back end of this.. but
that will do nothing for the lower order harmonics.

George H.

Jon Kirwan

unread,
Oct 13, 2011, 1:24:17 PM10/13/11
to

No problem. In the interim, I did a quick search for summing
junctions and Gray codes and came up with this link:

http://www.wiseguysynth.com/larry/schematics/walsh/walsh.pdf

I have NOT read it. But it looks about right to me as a zero
order approximation to what I was thinking about. I have
never considered doing what you are doing, but your writing
sprung two things immediately to mind. One is doing Fourier
analysis (which you should have already done, I imagine) and
the other is that you are possibly changing two outputs at
once and with that plus ripple carry stuff I get kind of
worried. All this would make me want to go to theory to
calculate my expectations and make sure they matched
experience in your testing. If I can't match them up, that
means I don't know enough and need to read more.

>The 4017 is just too simple!

Yeah. And you know what that means. Things should be as
simple as needed but no more so.

>I'm hoping all
>the swithing transients can just be filtered away. I put a little
>tweaker pot on the smallest R5 resistor and was able to get everything
>down below 60dB, so I'm thinking this is just a resistor tolerance/
>selection issue.
>I was just twisting different resistors together to get the
>approximate values, and didn't measure any of them. I'll try really
>nailing the values I want.
>
>Oh I'll add some multi-pole low pass on the back end of this.. but
>that will do nothing for the lower order harmonics.

I completely understand the problem in trying to filter out
2nd harmonics from the 1st. So yeah, that's not really a
good answer. Which is why I didn't really suggest it, but
instead went to Gray codes and the like.

Check out the link and see if it triggers anything. I will
read it a little later on, it's interesting to me regardless.
But it might apply from a cursory glance at it.

Jon

Jon Kirwan

unread,
Oct 13, 2011, 1:25:56 PM10/13/11
to
On Thu, 13 Oct 2011 10:24:17 -0700, I wrote:

>... and need to read more.

Better would be to have said, "and need to imagine, think,
and possibly read more." It does more for the soul.

Jon

Tim Wescott

unread,
Oct 13, 2011, 2:46:38 PM10/13/11
to

If you used 1% resistors, then getting 50dB was better than expectations
(1% error is about 40dB down, and if everything adds the wrong way you'll
get at least twice that).

0.1% resistors will, in theory, get you around 60dB down.

The rule of thumb for this sort of thing is that you can really only
expect a "by the book" nulling circuit (which is what you have) to stomp
things down by about 40dB, and if you really pull out the stops and hand-
tweak things then you can maybe get 60dB -- until someone breaths.

Instrument makers _can_ do better than this, but its only "routine"
inasmuch as the methods they use (shielding, tweaking, gold plating,
1000% overbuilt circuits, "Only Bob can do that" procedures, etc.) are
routine.

--
www.wescottdesign.com

John Larkin

unread,
Oct 13, 2011, 4:25:32 PM10/13/11
to
On Thu, 13 Oct 2011 13:46:38 -0500, Tim Wescott <t...@seemywebsite.com>
wrote:

We get over 60 dB in our arbs, but it's hard. We start with a 16 bit
differential current output DAC. The tough part is the downstream
amplifiers, especially past a couple of MHz.

There are major-brand RF signal generators with -20 dB harmonics.

John

George Herold

unread,
Oct 13, 2011, 4:53:07 PM10/13/11
to
> --www.wescottdesign.com- Hide quoted text -

>
> - Show quoted text -

Thanks Tim, I kinda figured that out on my own.

George H.

George Herold

unread,
Oct 13, 2011, 4:58:03 PM10/13/11
to
On Oct 13, 4:25 pm, John Larkin

That's a feature not a bug, you get a higher frequency generator
'cause of the big 3rd harmonic. :^)

We've got this el-cheapo RF generator that even has the 3rd harmonic
frequencies listed on the dial.

George H.
>
> John- Hide quoted text -

Phil Hobbs

unread,
Oct 13, 2011, 5:13:07 PM10/13/11
to
On 10/13/2011 12:39 PM, George Herold wrote:
> This is a continuation of the 50kHz VCO thread I started last week. I
> tried the stepped sine wave idea as suggested by James A, and Phil
> H.
> The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at
> frequency (F). The ten outputs from the 4017 are sent through
> appropriate resistors and into the summing junction of an opamp.
> Here�s a �scope shot of the stepped output overlaid with a sine

> wave.
>
> http://imageshack.us/photo/my-images/560/tek0024.png/
>
> The resistor values were chosen to intersect the sine wave at each new
> phase. (R(n) = 1/sin^2(n*18degrees))
>
> Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k,
> R4=R6=11k, R5=10k. all 1% resistors.
>
>
> Here�s the spectrum as recorded by an SRS770 spectrum analyzer.
>
> http://imageshack.us/photo/my-images/839/stepsin.png/
>
> The 2nd harmonic is only down by 50dB. I don�t understand why it�s so

> big. Is there some way to do better than this? The 9th and 11th
> harmonics are big and then the 19th and 21st.
>
> Thanks George H.
>

50 dB is only 0.3%, which isn't too bad. That might easily be due to
the output impedances of the 4017 drivers, or to the resistor
tolerances. Does it get better or worse when you change VDD? If so,
it's probably the output impedance.

Cheers

Phil Hobbs

Jim Thompson

unread,
Oct 13, 2011, 7:08:49 PM10/13/11
to

I posted this 8 years ago...

http://www.analog-innovations.com/SED/SineEqualsSumOfSquares.pdf

I also have this book...

"Sequency Theory, Foundations and Applications"
Henning F. Harmuth
Academic Press, 1977
ISBN: 0-12-014569-3

which covers Walsh Functions in gruesome detail ;-)

...Jim Thompson
--
| James E.Thompson, CTO | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona 85048 Skype: Contacts Only | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon at http://www.analog-innovations.com | 1962 |

I love to cook with wine. Sometimes I even put it in the food.

George Herold

unread,
Oct 13, 2011, 7:30:22 PM10/13/11
to
On Oct 13, 5:13 pm, Phil Hobbs

<pcdhSpamMeSensel...@electrooptical.net> wrote:
> On 10/13/2011 12:39 PM, George Herold wrote:
>
>
>
>
>
> > This is a continuation of the 50kHz VCO thread I started last week.  I
> > tried the stepped sine wave idea as suggested by James A, and Phil
> > H.
> > The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at
> > frequency (F).  The ten outputs from the 4017 are sent through
> > appropriate resistors and into the summing junction of an opamp.
> > Here’s a ‘scope shot of the stepped output overlaid with a sine

> > wave.
>
> >http://imageshack.us/photo/my-images/560/tek0024.png/
>
> > The resistor values were chosen to intersect the sine wave at each new
> > phase.  (R(n) = 1/sin^2(n*18degrees))
>
> > Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k,
> > R4=R6=11k, R5=10k.  all 1% resistors.
>
> > Here’s the spectrum as recorded by an SRS770 spectrum analyzer.
>
> >http://imageshack.us/photo/my-images/839/stepsin.png/
>
> > The 2nd harmonic is only down by 50dB.  I don’t understand why it’s so

> > big.  Is there some way to do better than this?  The 9th and 11th
> > harmonics are big and then the 19th and 21st.
>
> > Thanks George H.
>
> 50 dB is only 0.3%, which isn't too bad.   That might easily be due to
> the output impedances of the 4017 drivers, or to the resistor
> tolerances.  Does it get better or worse when you change VDD?  If so,
> it's probably the output impedance.
>
> Cheers
>
> Phil Hobbs- Hide quoted text -

>
> - Show quoted text -

Yeah, I was thinking about the output impedance. (I didn't looked at
the outputs from the 4017). When I decreased the supply voltage the
2nd harmonic was roughly constant while everything else went down. I
added a tweaker on the lowest resistance output and got everything
below the 9th close to 60 dB down. Which is almost beer time, except
it's only at 1kHz.

George H.

Jon Kirwan

unread,
Oct 13, 2011, 7:54:00 PM10/13/11
to
On Thu, 13 Oct 2011 16:08:49 -0700, Jim Thompson
<To-Email-Use-Th...@On-My-Web-Site.com> wrote:

>On Thu, 13 Oct 2011 10:24:17 -0700, Jon Kirwan
><jo...@infinitefactors.org> wrote:
>
>>On Thu, 13 Oct 2011 10:13:20 -0700 (PDT), George Herold
>><ghe...@teachspin.com> wrote:
>>

>>>On Oct 13, 12:59ļæ½pm, Jon Kirwan <j...@infinitefactors.org> wrote:
>>>> On Thu, 13 Oct 2011 09:39:21 -0700 (PDT), George Herold
>>>>
>>>> <gher...@teachspin.com> wrote:

>>>> >This is a continuation of the 50kHz VCO thread I started last week. ļæ½I


>>>> >tried the stepped sine wave idea as suggested by James A, and Phil
>>>> >H.
>>>> >The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at

>>>> >frequency (F). ļæ½The ten outputs from the 4017 are sent through


>>>> >appropriate resistors and into the summing junction of an opamp.

>>>> >Hereļæ½s a ļæ½scope shot of the stepped output overlaid with a sine


>>>> >wave.
>>>>
>>>> >http://imageshack.us/photo/my-images/560/tek0024.png/
>>>>
>>>> >The resistor values were chosen to intersect the sine wave at each new

>>>> >phase. ļæ½(R(n) = 1/sin^2(n*18degrees))


>>>>
>>>> >Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k,

>>>> >R4=R6=11k, R5=10k. ļæ½all 1% resistors.
>>>>
>>>> >Hereļæ½s the spectrum as recorded by an SRS770 spectrum analyzer.
>>>>
>>>> >http://imageshack.us/photo/my-images/839/stepsin.png/
>>>>
>>>> >The 2nd harmonic is only down by 50dB. ļæ½I donļæ½t understand why itļæ½s so
>>>> >big. ļæ½Is there some way to do better than this? ļæ½The 9th and 11th


>>>> >harmonics are big and then the 19th and 21st.
>>>>
>>>> >Thanks George H.
>>>>

>>>> George, I don't remember the discussion. ļæ½Probably didn't
>>>> read it. ļæ½But if you are using a 4017 (decade counter), then


>>>> I'm guessing that you are enabling one resistor at a time
>>>> while disabling others (they tie to the summing junction from

>>>> each, moving output pin.) ļæ½This worries me a little, mostly


>>>> because of delay and the fact that you are turning off one
>>>> while turning on another, but don't control that very well. I
>>>> also don't know what you are doing to filter the steps.
>>>>
>>>> Anyway, I'd have wanted to consider, instead, a Gray-coded
>>>> (actually, the real inventor is Boudot, I think, but Bell
>>>> Labs was patenting everything in a flurry in the mid 1900's
>>>> and who could remember Boudot so long ago?) design where you

>>>> only change one of the outputs at a time. ļæ½Not two.


>>>>
>>>> Anyway, I'll let the big hitters who probably did read the

>>>> earlier thread tell you what is more likely. ļæ½Just something


>>>> that crossed my mind, is all.
>>>>
>>>> Jon- Hide quoted text -
>>>>
>>>> - Show quoted text -
>>>
>>>Hi Jon, Thanks for that.
>>
>>No problem. In the interim, I did a quick search for summing
>>junctions and Gray codes and came up with this link:
>>
>>http://www.wiseguysynth.com/larry/schematics/walsh/walsh.pdf
>
>I posted this 8 years ago...
>
>http://www.analog-innovations.com/SED/SineEqualsSumOfSquares.pdf
>
>I also have this book...
>
>"Sequency Theory, Foundations and Applications"
>Henning F. Harmuth
>Academic Press, 1977
>ISBN: 0-12-014569-3
>
>which covers Walsh Functions in gruesome detail ;-)

I picke up Walsh's original paper (redone, actually, in Latex
and error corrected as it had a few in the original article)
from the web, today. The paper is "A Closed Set of Normal
Orthogonal Functions." I will be reading it more thoroughly
over the next couple of days. Also, already listed the above
link which is a nice, short overview with two examples in it.
Finally, there are a bevy of books (some of them nearly 1300
pages in length) on the subject regarding making and building
synthesizers. I'll be ordering a few before the end of the
week.

A whole world has opened up on this subject for me and I can
bring over Laplace and Fourier. Actually, it is almost easy
for me to see how to apply this with almost any starting wave
shape, not just sine/cosine or square wave. Which probably
isn't terribly practical, but interesting all the same. (Must
be some mathematician out there has already explored the use
of triangle, sawtooth, and pretty much any arbitrary basic
shape.)

I will read your PDF, as well. :)

Jon

Tim

unread,
Oct 13, 2011, 8:40:41 PM10/13/11
to

So -- how easily can you filter that out? IIRC you needed a 3:1
frequency span -- can you stand having nine filters or so, and switching
between them (I suppose if you're frequency modulating the answer is
"NO!").

--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com

Phil Hobbs

unread,
Oct 13, 2011, 9:32:25 PM10/13/11
to
On 10/13/2011 07:30 PM, George Herold wrote:
> On Oct 13, 5:13 pm, Phil Hobbs
> <pcdhSpamMeSensel...@electrooptical.net> wrote:
>> On 10/13/2011 12:39 PM, George Herold wrote:
>>
>>
>>
>>
>>
>>> This is a continuation of the 50kHz VCO thread I started last week. I
>>> tried the stepped sine wave idea as suggested by James A, and Phil
>>> H.
>>> The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at
>>> frequency (F). The ten outputs from the 4017 are sent through
>>> appropriate resistors and into the summing junction of an opamp.
>>> Here�s a �scope shot of the stepped output overlaid with a sine

>>> wave.
>>
>>> http://imageshack.us/photo/my-images/560/tek0024.png/
>>
>>> The resistor values were chosen to intersect the sine wave at each new
>>> phase. (R(n) = 1/sin^2(n*18degrees))
>>
>>> Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k,
>>> R4=R6=11k, R5=10k. all 1% resistors.
>>
>>> Here�s the spectrum as recorded by an SRS770 spectrum analyzer.
>>
>>> http://imageshack.us/photo/my-images/839/stepsin.png/
>>
>>> The 2nd harmonic is only down by 50dB. I don�t understand why it�s so

>>> big. Is there some way to do better than this? The 9th and 11th
>>> harmonics are big and then the 19th and 21st.
>>
>>> Thanks George H.
>>
>> 50 dB is only 0.3%, which isn't too bad. That might easily be due to
>> the output impedances of the 4017 drivers, or to the resistor
>> tolerances. Does it get better or worse when you change VDD? If so,
>> it's probably the output impedance.
>>
>> Cheers
>>
>> Phil Hobbs- Hide quoted text -
>>
>> - Show quoted text -
>
> Yeah, I was thinking about the output impedance. (I didn't looked at
> the outputs from the 4017). When I decreased the supply voltage the
> 2nd harmonic was roughly constant while everything else went down. I
> added a tweaker on the lowest resistance output and got everything
> below the 9th close to 60 dB down. Which is almost beer time, except
> it's only at 1kHz.
>
> George H.

Well, they come in HC too. ;)

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510
845-480-2058

hobbs at electrooptical dot net
http://electrooptical.net

dagmarg...@yahoo.com

unread,
Oct 13, 2011, 9:57:53 PM10/13/11
to
On Oct 13, 8:32 pm, Phil Hobbs wrote:
> On 10/13/2011 07:30 PM, George Herold wrote:
>
>
> > On Oct 13, 5:13 pm, Phil Hobbs  wrote:

> >> On 10/13/2011 12:39 PM, George Herold wrote:
>
> >>> This is a continuation of the 50kHz VCO thread I started last week.  I
> >>> tried the stepped sine wave idea as suggested by James A, and Phil
> >>> H.
> >>> The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at
> >>> frequency (F).  The ten outputs from the 4017 are sent through
> >>> appropriate resistors and into the summing junction of an opamp.
> >>> Here’s a ‘scope shot of the stepped output overlaid with a sine

> >>> wave.
>
> >>>http://imageshack.us/photo/my-images/560/tek0024.png/
>
> >>> The resistor values were chosen to intersect the sine wave at each new
> >>> phase.  (R(n) = 1/sin^2(n*18degrees))
>
> >>> Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k,
> >>> R4=R6=11k, R5=10k.  all 1% resistors.
>
> >>> Here’s the spectrum as recorded by an SRS770 spectrum analyzer.
>
> >>>http://imageshack.us/photo/my-images/839/stepsin.png/
>
> >>> The 2nd harmonic is only down by 50dB.  I don’t understand why it’s so

> >>> big.  Is there some way to do better than this?  The 9th and 11th
> >>> harmonics are big and then the 19th and 21st.
>
>
> >> 50 dB is only 0.3%, which isn't too bad.   That might easily be due to
> >> the output impedances of the 4017 drivers, or to the resistor
> >> tolerances.  Does it get better or worse when you change VDD?  If so,
> >> it's probably the output impedance.
>
>
>
> > Yeah, I was thinking about the output impedance. (I didn't looked at
> > the outputs from the 4017).  When I decreased the supply voltage the
> > 2nd harmonic was roughly constant while everything else went down.  I
> > added a tweaker on the lowest resistance output and got everything
> > below the 9th close to 60 dB down.   Which is almost beer time, except
> > it's only at 1kHz.
>
>
> Well, they come in HC too. ;)

Cool. I didn't think they made those in 'HC, but DigiKey says you're
right.


--
Cheers,
James Arthur

Phil Hobbs

unread,
Oct 13, 2011, 10:06:50 PM10/13/11
to
On 10/13/2011 09:57 PM, dagmarg...@yahoo.com wrote:
> On Oct 13, 8:32 pm, Phil Hobbs wrote:
>> On 10/13/2011 07:30 PM, George Herold wrote:
>>
>>
>>> On Oct 13, 5:13 pm, Phil Hobbs wrote:
>>>> On 10/13/2011 12:39 PM, George Herold wrote:
>>
>>>>> This is a continuation of the 50kHz VCO thread I started last week. I
>>>>> tried the stepped sine wave idea as suggested by James A, and Phil
>>>>> H.
>>>>> The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at
>>>>> frequency (F). The ten outputs from the 4017 are sent through
>>>>> appropriate resistors and into the summing junction of an opamp.
>>>>> Here�s a �scope shot of the stepped output overlaid with a sine

>>>>> wave.
>>
>>>>> http://imageshack.us/photo/my-images/560/tek0024.png/
>>
>>>>> The resistor values were chosen to intersect the sine wave at each new
>>>>> phase. (R(n) = 1/sin^2(n*18degrees))
>>
>>>>> Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k,
>>>>> R4=R6=11k, R5=10k. all 1% resistors.
>>
>>>>> Here�s the spectrum as recorded by an SRS770 spectrum analyzer.
>>
>>>>> http://imageshack.us/photo/my-images/839/stepsin.png/
>>
>>>>> The 2nd harmonic is only down by 50dB. I don�t understand why it�s so

>>>>> big. Is there some way to do better than this? The 9th and 11th
>>>>> harmonics are big and then the 19th and 21st.
>>
>>
>>>> 50 dB is only 0.3%, which isn't too bad. That might easily be due to
>>>> the output impedances of the 4017 drivers, or to the resistor
>>>> tolerances. Does it get better or worse when you change VDD? If so,
>>>> it's probably the output impedance.
>>
>>
>>
>>> Yeah, I was thinking about the output impedance. (I didn't looked at
>>> the outputs from the 4017). When I decreased the supply voltage the
>>> 2nd harmonic was roughly constant while everything else went down. I
>>> added a tweaker on the lowest resistance output and got everything
>>> below the 9th close to 60 dB down. Which is almost beer time, except
>>> it's only at 1kHz.
>>
>>
>> Well, they come in HC too. ;)
>
> Cool. I didn't think they made those in 'HC, but DigiKey says you're
> right.
>

It's the physicist's version of the 555. ;)

dagmarg...@yahoo.com

unread,
Oct 13, 2011, 9:41:57 PM10/13/11
to
On Oct 13, 6:30 pm, George Herold <gher...@teachspin.com> wrote:
> Yeah, I was thinking about the output impedance. (I didn't looked at
> the outputs from the 4017).  When I decreased the supply voltage the
> 2nd harmonic was roughly constant while everything else went down.  I
> added a tweaker on the lowest resistance output and got everything
> below the 9th close to 60 dB down.   Which is almost beer time, except
> it's only at 1kHz.


The outputs are loaded. The effect of this overloading is to squish
the upper part of the waveform, distorting it. It looks like you've
tweaked values pretty optimally to compensate, but that's part-
dependent. How about multiplying all those resistances by 10?

These are the relative step-sizes you should be seeing (calculated
from your resistor values, in 'scope divisions, scaled and offset to
match the 'scope screen shot you posted):

(view in fixed font)

calc'd actual desired
0.2 0.2 0.2
1.05 1 0.93
3.15 2.9 2.82
5.47 5.2 5.17
7.22 7.05 7.07
7.8 7.8 7.8

(sequence repeats, falling)

Looks pretty good, but FWIW steps 1-9 and 3-9 look slightly mis-
matched.

--
Cheers,
James Arthur

dagmarg...@yahoo.com

unread,
Oct 13, 2011, 10:13:28 PM10/13/11
to
On Oct 13, 6:30 pm, George Herold <gher...@teachspin.com> wrote:
> On Oct 13, 5:13 pm, Phil Hobbs wrote:
> > On 10/13/2011 12:39 PM, George Herold wrote:
>
> > > This is a continuation of the 50kHz VCO thread I started last week.  I
> > > tried the stepped sine wave idea as suggested by James A, and Phil
> > > H.
> > > The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at
> > > frequency (F).  The ten outputs from the 4017 are sent through
> > > appropriate resistors and into the summing junction of an opamp.
> > > Here’s a ‘scope shot of the stepped output overlaid with a sine
> > > wave.
>
> > >http://imageshack.us/photo/my-images/560/tek0024.png/
>
> > > The resistor values were chosen to intersect the sine wave at each new
> > > phase.  (R(n) = 1/sin^2(n*18degrees))
>
> > > Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k,
> > > R4=R6=11k, R5=10k.  all 1% resistors.
>
> > > Here’s the spectrum as recorded by an SRS770 spectrum analyzer.
>
> > >http://imageshack.us/photo/my-images/839/stepsin.png/
>
> > > The 2nd harmonic is only down by 50dB.  I don’t understand why it’s so
> > > big.  Is there some way to do better than this?  The 9th and 11th
> > > harmonics are big and then the 19th and 21st.
>
>
> > 50 dB is only 0.3%, which isn't too bad.   That might easily be due to
> > the output impedances of the 4017 drivers, or to the resistor
> > tolerances.  Does it get better or worse when you change VDD?  If so,
> > it's probably the output impedance.
>
>
> Yeah, I was thinking about the output impedance. (I didn't looked at
> the outputs from the 4017).  When I decreased the supply voltage the
> 2nd harmonic was roughly constant while everything else went down.  I
> added a tweaker on the lowest resistance output and got everything
> below the 9th close to 60 dB down.   Which is almost beer time, except
> it's only at 1kHz.

I posted (and Google lost) a long post, the gist of which was:

(view in fixed font)
desired,
G.H. desired, scaled to George's
values theoretical 'scope actual
(volts) (volts) (div) (div)
0.000 0.000 0.2 0.2
0.093 0.079 0.93 1.0
0.323 0.287 2.82 2.8
0.577 0.545 5.17 5.2
0.768 0.753 7.07 7.05
0.832 0.832 7.8 7.8

(1rst column is the expected outputs based on your resistor values)

So, the outputs are loaded, but you've tweaked the resistors from the
reported values to compensate. That's device-dependent. Might wanna
up the resistances or switch to 'HC.

The actual waveform looks pretty good. Some of the steps look a
little mis-matched, e.g. 2-8 and 3-7

--
Cheers,
James Arthur

George Herold

unread,
Oct 13, 2011, 10:14:04 PM10/13/11
to
> Control system and signal processing consultingwww.wescottdesign.com- Hide quoted text -

>
> - Show quoted text -

Oh, the single low pass has to start before the 9th harmonic of the
lowest frequency (~30kHz*) so I'm thinking around 200 kHz. The
resistors have to take care of the lower harmonics. (which is why the
2nd is so disturbing) 9 or 10, 0.1% resistors are not 'out of the
question' only ~$2 + the cost of placing them. Though 1% would be
nicer.

George H.

*the specs are still a bit fluid, which is a good thing.

George Herold

unread,
Oct 13, 2011, 10:25:32 PM10/13/11
to
On Oct 13, 9:32 pm, Phil Hobbs

<pcdhSpamMeSensel...@electrooptical.net> wrote:
> On 10/13/2011 07:30 PM, George Herold wrote:
>
>
>
>
>
> > On Oct 13, 5:13 pm, Phil Hobbs
> > <pcdhSpamMeSensel...@electrooptical.net>  wrote:
> >> On 10/13/2011 12:39 PM, George Herold wrote:
>
> >>> This is a continuation of the 50kHz VCO thread I started last week.  I
> >>> tried the stepped sine wave idea as suggested by James A, and Phil
> >>> H.
> >>> The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at
> >>> frequency (F).  The ten outputs from the 4017 are sent through
> >>> appropriate resistors and into the summing junction of an opamp.
> >>> Here’s a ‘scope shot of the stepped output overlaid with a sine

> >>> wave.
>
> >>>http://imageshack.us/photo/my-images/560/tek0024.png/
>
> >>> The resistor values were chosen to intersect the sine wave at each new
> >>> phase.  (R(n) = 1/sin^2(n*18degrees))
>
> >>> Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k,
> >>> R4=R6=11k, R5=10k.  all 1% resistors.
>
> >>> Here’s the spectrum as recorded by an SRS770 spectrum analyzer.
>
> >>>http://imageshack.us/photo/my-images/839/stepsin.png/
>
> >>> The 2nd harmonic is only down by 50dB.  I don’t understand why it’s so

> >>> big.  Is there some way to do better than this?  The 9th and 11th
> >>> harmonics are big and then the 19th and 21st.
>
> >>> Thanks George H.
>
> >> 50 dB is only 0.3%, which isn't too bad.   That might easily be due to
> >> the output impedances of the 4017 drivers, or to the resistor
> >> tolerances.  Does it get better or worse when you change VDD?  If so,
> >> it's probably the output impedance.
>
> >> Cheers
>
> >> Phil Hobbs- Hide quoted text -
>
> >> - Show quoted text -
>
> > Yeah, I was thinking about the output impedance. (I didn't looked at
> > the outputs from the 4017).  When I decreased the supply voltage the
> > 2nd harmonic was roughly constant while everything else went down.  I
> > added a tweaker on the lowest resistance output and got everything
> > below the 9th close to 60 dB down.   Which is almost beer time, except
> > it's only at 1kHz.
>
> > George H.
>
> Well, they come in HC too. ;)

The MC claims 16 MHz, and goes to 18V (it's nice running everything
off +/-15 volt supplies) Should I have ordered some HC too?

George H.


>
> Cheers
>
> Phil Hobbs
>
> --
> Dr Philip C D Hobbs
> Principal Consultant
> ElectroOptical Innovations LLC
> Optics, Electro-optics, Photonics, Analog Electronics
>
> 160 North State Road #203
> Briarcliff Manor NY 10510
> 845-480-2058
>

> hobbs at electrooptical dot nethttp://electrooptical.net- Hide quoted text -

Phil Hobbs

unread,
Oct 13, 2011, 10:54:38 PM10/13/11
to
On 10/13/2011 10:25 PM, George Herold wrote:
> On Oct 13, 9:32 pm, Phil Hobbs
> <pcdhSpamMeSensel...@electrooptical.net> wrote:
>> On 10/13/2011 07:30 PM, George Herold wrote:
>>
>>
>>
>>
>>
>>> On Oct 13, 5:13 pm, Phil Hobbs
>>> <pcdhSpamMeSensel...@electrooptical.net> wrote:
>>>> On 10/13/2011 12:39 PM, George Herold wrote:
>>
>>>>> This is a continuation of the 50kHz VCO thread I started last week. I
>>>>> tried the stepped sine wave idea as suggested by James A, and Phil
>>>>> H.
>>>>> The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at
>>>>> frequency (F). The ten outputs from the 4017 are sent through
>>>>> appropriate resistors and into the summing junction of an opamp.
>>>>> Here�s a �scope shot of the stepped output overlaid with a sine

>>>>> wave.
>>
>>>>> http://imageshack.us/photo/my-images/560/tek0024.png/
>>
>>>>> The resistor values were chosen to intersect the sine wave at each new
>>>>> phase. (R(n) = 1/sin^2(n*18degrees))
>>
>>>>> Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k,
>>>>> R4=R6=11k, R5=10k. all 1% resistors.
>>
>>>>> Here�s the spectrum as recorded by an SRS770 spectrum analyzer.
>>
>>>>> http://imageshack.us/photo/my-images/839/stepsin.png/
>>
>>>>> The 2nd harmonic is only down by 50dB. I don�t understand why it�s so

>>>>> big. Is there some way to do better than this? The 9th and 11th
>>>>> harmonics are big and then the 19th and 21st.
>>
>>>>> Thanks George H.
>>
>>>> 50 dB is only 0.3%, which isn't too bad. That might easily be due to
>>>> the output impedances of the 4017 drivers, or to the resistor
>>>> tolerances. Does it get better or worse when you change VDD? If so,
>>>> it's probably the output impedance.
>>
>>>> Cheers
>>
>>>> Phil Hobbs- Hide quoted text -
>>
>>>> - Show quoted text -
>>
>>> Yeah, I was thinking about the output impedance. (I didn't looked at
>>> the outputs from the 4017). When I decreased the supply voltage the
>>> 2nd harmonic was roughly constant while everything else went down. I
>>> added a tweaker on the lowest resistance output and got everything
>>> below the 9th close to 60 dB down. Which is almost beer time, except
>>> it's only at 1kHz.
>>
>>> George H.
>>
>> Well, they come in HC too. ;)
>
> The MC claims 16 MHz, and goes to 18V (it's nice running everything
> off +/-15 volt supplies) Should I have ordered some HC too?
>
> George H.


Well, they're a fair amount faster, which means that the edge artifacts
aren't as serious, and their output resistance is less, which means that
the total resistance in each tap is more predictable.

dagmarg...@yahoo.com

unread,
Oct 14, 2011, 5:32:45 AM10/14/11
to
On Oct 13, 9:54 pm, Phil Hobbs

<pcdhSpamMeSensel...@electrooptical.net> wrote:
> On 10/13/2011 10:25 PM, George Herold wrote:
>
>
>
> > On Oct 13, 9:32 pm, Phil Hobbs
> > <pcdhSpamMeSensel...@electrooptical.net>  wrote:
> >> On 10/13/2011 07:30 PM, George Herold wrote:
>
> >>> On Oct 13, 5:13 pm, Phil Hobbs
> >>> <pcdhSpamMeSensel...@electrooptical.net>    wrote:
> >>>> On 10/13/2011 12:39 PM, George Herold wrote:
>
> >>>>> This is a continuation of the 50kHz VCO thread I started last week.  I
> >>>>> tried the stepped sine wave idea as suggested by James A, and Phil
> >>>>> H.
> >>>>> The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at
> >>>>> frequency (F).  The ten outputs from the 4017 are sent through
> >>>>> appropriate resistors and into the summing junction of an opamp.
> >>>>> Here’s a ‘scope shot of the stepped output overlaid with a sine

> >>>>> wave.
>
> >>>>>http://imageshack.us/photo/my-images/560/tek0024.png/
>
> >>>>> The resistor values were chosen to intersect the sine wave at each new
> >>>>> phase.  (R(n) = 1/sin^2(n*18degrees))
>
> >>>>> Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k,
> >>>>> R4=R6=11k, R5=10k.  all 1% resistors.
>
> >>>>> Here’s the spectrum as recorded by an SRS770 spectrum analyzer.
>
> >>>>>http://imageshack.us/photo/my-images/839/stepsin.png/
>
> >>>>> The 2nd harmonic is only down by 50dB.  I don’t understand why it’s so

> >>>>> big.  Is there some way to do better than this?  The 9th and 11th
> >>>>> harmonics are big and then the 19th and 21st.
>
> >>>>> Thanks George H.
>
> >>>> 50 dB is only 0.3%, which isn't too bad.   That might easily be due to
> >>>> the output impedances of the 4017 drivers, or to the resistor
> >>>> tolerances.  Does it get better or worse when you change VDD?  If so,
> >>>> it's probably the output impedance.
>
> >>>> Cheers
>
> >>>> Phil Hobbs- Hide quoted text -
>
> >>>> - Show quoted text -
>
> >>> Yeah, I was thinking about the output impedance. (I didn't looked at
> >>> the outputs from the 4017).  When I decreased the supply voltage the
> >>> 2nd harmonic was roughly constant while everything else went down.  I
> >>> added a tweaker on the lowest resistance output and got everything
> >>> below the 9th close to 60 dB down.   Which is almost beer time, except
> >>> it's only at 1kHz.
>
> >>> George H.
>
> >> Well, they come in HC too. ;)
>
> > The MC claims 16 MHz, and goes to 18V (it's nice running everything
> > off +/-15 volt supplies)  Should I have ordered some HC too?
>
> > George H.
>
> Well, they're  a fair amount faster, which means that the edge artifacts
> aren't as serious, and their output resistance is less, which means that
> the total resistance in each tap is more predictable.

Yes. Higher Vdd helps the CD4017 too.

There's still the idea of adding a switched-cap tracking filter,
running at 50f or 100f, etc.

--
Cheers,
James Arthur

George Herold

unread,
Oct 14, 2011, 10:02:08 AM10/14/11
to

Yeah, a switched cap filter on the back side might be cool. Then the
thing wouldn't be limited on the low frequency end. I've got some
from another project.

George H.
> --
> Cheers,
> James Arthur- Hide quoted text -

Jim Thompson

unread,
Oct 14, 2011, 11:15:09 AM10/14/11
to

It'd be trivial to make an N-path filter following a square wave, then
a simple-minded smoothing R/C.

George Herold

unread,
Oct 14, 2011, 3:41:21 PM10/14/11
to
> James Arthur- Hide quoted text -

>
> - Show quoted text -

Hi James, Yeah I was loading down the output of the 4017. I measured
an output impedance of ~180 ohms. I put this number in and
recalcualted values, and then selected them to ~0.1% with a DMM. The
result.... I've got all the harmonics below the 9th down by ~70dB! I
don't know how repeatable the the output imedance is? I put in a few
different 4017's and say no difference, but these were all from the
same order, so...

Here's a plot from the SRS770.
http://imageshack.us/photo/my-images/7/vco2.png/

Now I've got to get it off the white proto-board and crank up the
frequency.

George H.

George Herold

unread,
Oct 14, 2011, 3:55:17 PM10/14/11
to
On Oct 14, 11:15 am, Jim Thompson <To-Email-Use-The-Envelope-I...@On-
> | E-mail Icon athttp://www.analog-innovations.com|    1962     |
>
> I love to cook with wine.     Sometimes I even put it in the food.- Hide quoted text -

>
> - Show quoted text -

Hmm, not trivail for me since I have no idea what an N-path filter
is. But I'm googling...

George H.

dagmarg...@yahoo.com

unread,
Oct 14, 2011, 4:59:31 PM10/14/11
to
> Hi James,  Yeah I was loading down the output of the 4017.  I measured
> an output impedance of ~180 ohms.  I put this number in and
> recalcualted values,  and then selected them to ~0.1% with a DMM.  The
> result.... I've got all the harmonics below the 9th down by ~70dB!  I
> don't know how repeatable the the output imedance is?  I put in a few
> different 4017's and say no difference, but these were all from the
> same order, so...
>
> Here's a plot from the SRS770.http://imageshack.us/photo/my-images/7/vco2.png/

Beautiful, and well worth the resistors, right? Compared to the cost
and complexity of extra hardware, it's a bargain.

For each half-wave, I'd analyze this as the sum of three impulses, one
inside the other, added together. The phasing and amplitude of those
impulses is critical to canceling harmonics.

.---.
.--' '--.
| |
.-' '-.
___| |___
| |
-' '-


My gut wants to say--but I'm too lazy to prove right now--that having
the same voltages repeated symmetrically on either side of each peak
is critical to harmonic rejection.

Where the voltage is unequal on either side, you introduce a new
impulse with a magnitude equal to the difference in voltages. It's
easy to *introduce* a 2nd harmonic component that way. For example,
taking the middle impulse:

.-----.
| '----.
| |
| | |
___|__________|_________|__
| |
| |
|____ |
'----'


My original thinking was to have an up/down counter, a single homemade
DAC, cycle up and down through the same (sine-weighted) values, then
invert (externally) for the negative swing. That gets you 4x as many
steps and automatic symmetry, but it's not nearly as cute as Phil's
4017.

> Now I've got to get it off the white proto-board and crank up the
> frequency.
>
> George H.

--
Cheers,
James Arthur

Jim Thompson

unread,
Oct 14, 2011, 6:33:10 PM10/14/11
to
I posted several links (last month?) and a paper by Franks and
Sandberg.

...Jim Thompson
--
| James E.Thompson, CTO | mens |
| Analog Innovations, Inc. | et |
| Analog/Mixed-Signal ASIC's and Discrete Systems | manus |
| Phoenix, Arizona 85048 Skype: Contacts Only | |
| Voice:(480)460-2350 Fax: Available upon request | Brass Rat |
| E-mail Icon at http://www.analog-innovations.com | 1962 |

Phil Hobbs

unread,
Oct 14, 2011, 8:07:23 PM10/14/11
to
Cool! 4017s rule--they're dead useful and just complicated enough that
the anti-555 fascists don't notice. :)

I use them for things like getting guaranteed break-before-make from
74HC4016-style analogue switches. Of course, I've also used PALs as
analogue components, so I have no shame whatever.

George Herold

unread,
Oct 14, 2011, 11:58:26 PM10/14/11
to
Yeah, I was hoping for 60dB. When I crank up the frequency
capacitance is going to start to byte me, but now I've got dB's to
spare.
>
> For each half-wave, I'd analyze this as the sum of three impulses, one
> inside the other, added together.  The phasing and amplitude of those
> impulses is critical to canceling harmonics.
>
>         .---.
>      .--'   '--.
>      |         |
>    .-'         '-.
> ___|             |___
>    |             |
>   -'             '-
>
> My gut wants to say--but I'm too lazy to prove right now--that having
> the same voltages repeated symmetrically on either side of each peak
> is critical to harmonic rejection.

Hmm you're suggesting that matching between equal value resistors is
more important than hitting some exact number. I think, that might be
true.... or does matching effect the odd harmonics and absolute value
the even?

George H.
>
> Where the voltage is unequal on either side, you introduce a new
> impulse with a magnitude equal to the difference in voltages. It's
> easy to *introduce* a 2nd harmonic component that way.  For example,
> taking the middle impulse:
>
>    .-----.
>    |     '----.
>    |          |
>    |          |         |
> ___|__________|_________|__
>               |         |
>               |         |
>               |____     |
>                    '----'
>
> My original thinking was to have an up/down counter, a single homemade
> DAC, cycle up and down through the same (sine-weighted) values, then
> invert (externally) for the negative swing.  That gets you 4x as many
> steps and automatic symmetry, but it's not nearly as cute as Phil's
> 4017.
>
> > Now I've got to get it off the white proto-board and crank up the
> > frequency.
>
> > George H.
>
> --
> Cheers,

George Herold

unread,
Oct 15, 2011, 12:10:25 AM10/15/11
to
On Oct 14, 8:07 pm, Phil Hobbs
> hobbs at electrooptical dot nethttp://electrooptical.net- Hide quoted text -
>
> - Show quoted text -

Oh, Thank you Phil! I'm not above anything that gets the job done.

George H.

George Herold

unread,
Oct 15, 2011, 12:25:28 AM10/15/11
to
Hmm you're suggesting that matching between equal value resistors it
more important than hitting exact values?
>
> Where the voltage is unequal on either side, you introduce a new
> impulse with a magnitude equal to the difference in voltages. It's
> easy to *introduce* a 2nd harmonic component that way.  For example,
> taking the middle impulse:
>
>    .-----.
>    |     '----.
>    |          |
>    |          |         |
> ___|__________|_________|__
>               |         |
>               |         |
>               |____     |
>                    '----'
>
> My original thinking was to have an up/down counter, a single homemade
> DAC, cycle up and down through the same (sine-weighted) values, then
> invert (externally) for the negative swing.  That gets you 4x as many
> steps and automatic symmetry, but it's not nearly as cute as Phil's
> 4017.
>
> > Now I've got to get it off the white proto-board and crank up the
> > frequency.
>
> > George H.
>
> --
> Cheers,

dagmarg...@yahoo.com

unread,
Oct 15, 2011, 9:31:16 AM10/15/11
to
I'm suggesting the possibility, but that's only a suspicion--I showed
one example below. OTOH, I also just installed a virtual caterpillar
grommet backwards in another thread. :-)

As a practical matter, Phil's 'HC4017 with precision resistors seems
best.

> > Where the voltage is unequal on either side, you introduce a new
> > impulse with a magnitude equal to the difference in voltages. It's
> > easy to *introduce* a 2nd harmonic component that way.  For example,
> > taking the middle impulse:
>
> >    .-----.
> >    |     '----.
> >    |          |
> >    |          |         |
> > ___|__________|_________|__
> >               |         |
> >               |         |
> >               |____     |
> >                    '----'
>
> > My original thinking was to have an up/down counter, a single homemade
> > DAC, cycle up and down through the same (sine-weighted) values, then
> > invert (externally) for the negative swing.  That gets you 4x as many
> > steps and automatic symmetry, but it's not nearly as cute as Phil's
> > 4017.


FWIW, here's what I'd imagined, where v0-v7 encode a half-wave:

'HC4051
.-----.
v7-----|0 |
v6-----|1 |
v5-----|2 |
v4-----|3 Y|----
v3-----|4 |
v2-----|5 |
v1-----|6 |
v0-----|7 |
| ABC |
'-----'
|||
.---.
|XOR|<-.
'---' |
||| .-'
||| |
.------.
| ABC D|
16x clk -|> | 4-bit Counter
| |
'------'

This logic walks up and down through 8 voltages, which, since they are
reused from the same source, are duplicated exactly on each side of
the peak. That does not guarantee symmetry about zero, though.

Another possibility is to make v0-v7 encode a quarter-wave, then
multiply by +/-1 afterwards in analog, ensuring full symmetry.

Mine's three chips, minimum, to Phil's one. My original goal was to
ease filtering by maximizing steps. I'm not ultimately sure this is
any better w.r.t. even harmonics--that could be resistor-precision
limited...I haven't done the math.

--
Cheers,
James Arthur

patricia herold

unread,
Oct 15, 2011, 3:43:20 PM10/15/11
to
Ha, following your bipolar idea, I was wondering if I could program
the 4017 for 1/2 a sine wave and use the carry output to flip a +/-1
opamp down stream. I guess that means another chip.

>
> Mine's three chips, minimum, to Phil's one.  My original goal was to
> ease filtering by maximizing steps.  I'm not ultimately sure this is
> any better w.r.t. even harmonics--that could be resistor-precision
> limited...I haven't done the math.

Oh don't do any math on my account. And thanks for the ideas!
Doubling the number of steps doubles the clock frequency, which seems
to suggest that capacitance will get you at some lower output
frequency. I'm assuming that rounding off the nice sharp steps will
screw things up.

George H.
>
> --
> Cheers,
> James Arthur- Hide quoted text -
>
> - Show quoted text -- Hide quoted text -

George Herold

unread,
Oct 15, 2011, 3:51:35 PM10/15/11
to
Opps, that wasn't my wife responding.

George H.

Phil Hobbs

unread,
Oct 15, 2011, 3:55:48 PM10/15/11
to
Here we were thinking what a talented woman she must be, jumping
straight in on topic like that. ;)

Cheers

Phil Hobbs
>
> George H.

Michael A. Terrell

unread,
Oct 15, 2011, 5:56:35 PM10/15/11
to
Or that he used a different name, on the weekends. ;-)


--
You can't have a sense of humor, if you have no sense.

Phil Hobbs

unread,
Oct 15, 2011, 6:04:55 PM10/15/11
to
You've been spending too much time in Key West.

Cheers

Phil Hobbs

(Just back from visiting my daughter, who has an apartment a block from
Bourbon Street. The difference seems to be that in the French Quarter
the dives cater mostly to tourists, whereas in Key West they're for the
locals!)

John Larkin

unread,
Oct 15, 2011, 6:13:27 PM10/15/11
to
Did you have the fried oyster po-boy at Felix's?

John


Michael A. Terrell

unread,
Oct 15, 2011, 6:32:21 PM10/15/11
to
I've never been south of Orlando.

Phil Hobbs

unread,
Oct 15, 2011, 6:34:32 PM10/15/11
to
Not yet. But I did get both kinds of Zatarain's Crab & Shrimp Boil and
a bottle of Arnaud's remoulade.

Cheers

Phil Hobbs

George Herold

unread,
Oct 16, 2011, 1:22:26 AM10/16/11
to
On Oct 15, 6:13 pm, John Larkin
> John- Hide quoted text -
>
> - Show quoted text -

Mmmm, I was there several years ago for a March APS meeting...
slurping oysters at some fine dining establishemnt (not Felix's).
When we came back for the third night we were 'regulars' and 'our'
waitress brought us a few raw ones each as soon as we sat down... to
tide us over until she could take our order.
Nothing beats a mug of beer, a plate of oysters and some of those
little salty potatoes, after a long day at a trade show.

George H.

dagmarg...@yahoo.com

unread,
Oct 16, 2011, 9:25:38 AM10/16/11
to
That's the "another possibility" I meant, above. The DAC only has to
cover 1/4 of a sinewave, and you get the remaining wave portions by
manipulating that.

To wit, the external logic walks the DAC up, then down, then kicks on
the analog invert (x -1) function and cycles up, then down again.
Then, back to the beginning.

That, here, would take about 5 chips & get you 32 samples per
sinewave.

So, we've got several versions: 10 steps with one chip, 16 steps with
three chips, or 32 steps for five chips. Or, as always, you could use
a PIC :-)


> > Mine's three chips, minimum, to Phil's one.  My original goal was to
> > ease filtering by maximizing steps.  I'm not ultimately sure this is
> > any better w.r.t. even harmonics--that could be resistor-precision
> > limited...I haven't done the math.
>
> Oh don't do any math on my account.  And thanks for the ideas!
> Doubling the number of steps doubles the clock frequency, which seems
> to suggest that capacitance will get you at some lower output
> frequency.  I'm assuming that rounding off the nice sharp steps will
> screw things up.

I'm not sure what capacitance you're concerned about. The CMOS
doesn't care--it's fast. Stray loading on the DAC? That should be
pretty trivial at these frequencies. Besides, it works in your favor,
filtering out the higher-harmonics.


--
Cheers,
James Arthur

dagmarg...@yahoo.com

unread,
Oct 16, 2011, 9:30:03 AM10/16/11
to
> Opps, that wasn't my wife responding.
>
> George H.


Well if it wasn't, for heaven's sake don't post that here!

"To our wives and our girlfriends ... may they never meet."(*) --Old
bachelor party toast.

(*)(P.S. I first typed that as "girlfiends" -- may those especially
never meet!)


--
Cheers,
James Arthur

k...@att.bizzzzzzzzzzzz

unread,
Oct 16, 2011, 9:55:16 AM10/16/11
to
Or an 8-bit counter (e.g. '579), ROM, and DAC. 256 steps, three chips. ;-)

The synchronous counter is the limitation, here.

George Herold

unread,
Oct 16, 2011, 11:04:29 AM10/16/11
to
Hmm I'm not sure either, now you mention it. I guess I'm (half)
thinking of the output of the summing opamp. But, that's perhaps more
a slew rate issue.

Anyway thanks for all the fun ideas!

dagmarg...@yahoo.com

unread,
Oct 16, 2011, 1:42:48 PM10/16/11
to
On Oct 16, 8:55 am, "k...@att.bizzzzzzzzzzzz"
<k...@att.bizzzzzzzzzzzz> wrote:
Hey, how about two 'HC4017's, driven out-of-phase. Clock one rising,
one falling. That's 20 steps, two chips, dirt-simple.

--
Cheers,
James Arthur

dagmarg...@yahoo.com

unread,
Oct 16, 2011, 1:47:04 PM10/16/11
to
Of course. Thanks be to you for the fun puzzle, for actually doing
it, and then posting back. That's fun for everyone.

--
Cheers,
James Arthur

whit3rd

unread,
Oct 16, 2011, 4:19:11 PM10/16/11
to
On Thursday, October 13, 2011 7:14:04 PM UTC-7, George Herold wrote:

[about making a sine with steps set by resistor values]

> resistors have to take care of the lower harmonics. (which is why the
> 2nd is so disturbing) 9 or 10, 0.1% resistors are not 'out of the
> question' only ~$2 + the cost of placing them. Though 1% would be
> nicer.

Manufacturers, take note! If one can build/sell a RAMDAC ( old video part,
intended to encode colors), how about a sine-table ROMDAC?
Can you beat the price of ten $2 resistors, with 8-bit output converter?

k...@att.bizzzzzzzzzzzz

unread,
Oct 16, 2011, 7:09:18 PM10/16/11
to
An FPGA. Hundreds of steps, one chip. Pick your poison. ;-)

josephkk

unread,
Oct 16, 2011, 10:44:10 PM10/16/11
to
The way i see it matching will impact even more than odd and absolute
value will impact odd more than even. But each will impact both. It is a
small enough dft that it is worth cranking it up in a spreadsheet.

dagmarg...@yahoo.com

unread,
Oct 16, 2011, 11:43:12 PM10/16/11
to
On Oct 16, 6:09 pm, "k...@att.bizzzzzzzzzzzz" wrote:
Come to think of it, I suspect staggered 'HC4017's doesn't work. Each
output of "B" would straddle (be active during) two output states of
"A", and the simultaneous equations fail. You'd need to buffer 'em so
you could enable just one 'HC4017 at a time, which is messy & takes
more chips.

So, it's either one 'HC4017, or a PIC. (Or a 555, details left as an
exercise for the student.)

--
Cheers,
James Arthur

Phil Hobbs

unread,
Oct 17, 2011, 12:10:09 AM10/17/11
to
On 10/16/2011 11:43 PM, dagmarg...@yahoo.com wrote:
> On Oct 16, 6:09 pm, "k...@att.bizzzzzzzzzzzz" wrote:
>> On Sun, 16 Oct 2011 10:42:48 -0700 (PDT), dagmargoodb...@yahoo.com wrote:
>>> On Oct 16, 8:55 am, "k...@att.bizzzzzzzzzzzz" wrote:
>>>> On Sun, 16 Oct 2011 06:25:38 -0700 (PDT), dagmargoodb...@yahoo.com wrote:
>
>>>>> So, we've got several versions: 10 steps with one chip, 16 steps with
>>>>> three chips, or 32 steps for five chips. Or, as always, you could use
>>>>> a PIC :-)
>>
>>>> Or an 8-bit counter (e.g. '579), ROM, and DAC. 256 steps, three chips. ;-)
>>
>>>> The synchronous counter is the limitation, here.
>>
>>> Hey, how about two 'HC4017's, driven out-of-phase. Clock one rising,
>>> one falling. That's 20 steps, two chips, dirt-simple.
>>
>> An FPGA. Hundreds of steps, one chip. Pick your poison. ;-)
>
> Come to think of it, I suspect staggered 'HC4017's doesn't work. Each
> output of "B" would straddle (be active during) two output states of
> "A", and the simultaneous equations fail. You'd need to buffer 'em so
> you could enable just one 'HC4017 at a time, which is messy& takes
> more chips.
>
> So, it's either one 'HC4017, or a PIC. (Or a 555, details left as an
> exercise for the student.)
>
> --
> Cheers,
> James Arthur

We really need a 4017 with tri-state outputs. ;)

You could take advantage of the particular phase choice that George
used, i.e. one phase is disconnected, and use a bunch of SIPO shift
registers. Do a synchronous reset of all of them when the last stage
goes high, and use an R-S flipflop to inject a 1 into the first stage
when that happens, reset from the output of the first stage.

It would also need a missing pulse detector or something like that to
make sure that it doesn't just sit there producing all zeros forever.
You could get 8N+1 phases for about N+2 packages and 8N resistors.

Alternatively, adapting your folding trick, it might be possible to use
a bunch of universal shift registers and just shuttle the 1-state back
and forth from end to end, by changing the shift direction when it hits
the end. That way you'd get 16N or maybe 16N-1 codes for N + 3ish
packages and 8N resistors.

Fun.

George Herold

unread,
Oct 17, 2011, 9:50:40 AM10/17/11
to
Hi Whit3rd, Are you making fun of me?

You can get 0.1% resostors from Sussumu for ~$0.20 each.
George H.

George Herold

unread,
Oct 17, 2011, 10:03:51 AM10/17/11
to
resistors Susumu
> George H.

Geesh, be nice if I could spell say every other word correctly.

George Herold

unread,
Oct 17, 2011, 10:02:20 AM10/17/11
to
Dat's OK James, I'm still pondering your idea of multiple
switching... using each resistor four times during a cycle. (I'm a
bit slow so it takes me a while to digest what you are suggesting.) I
must admit that the symmetry is appealing.

George H.

josephkk

unread,
Oct 17, 2011, 11:08:52 PM10/17/11
to
Got me to thimkin'. Two 74hc374 in a Johnson twisted ring counter with
16 resistors will get you 32 steps. Can get 16 steps with a single '374
and 8 resistors. Have to pay attention to initialization though. Calcs
for the resistors will be a little different though, may be a problem if
the High and Low drive strengths are different. Don't see one in 4000
style cmos.

?-)

speff

unread,
Oct 18, 2011, 9:04:15 AM10/18/11
to
The Apple start-up sound is called Sosumi- a legacy of the legal
troubles between
Apple and the Beatles. It was thought by their legal beagles to be a
better choice than
"Let it beep".

--sp

Phil Hobbs

unread,
Oct 18, 2011, 9:48:27 AM10/18/11
to
The problem is that there's no linear mapping from that to a sine
wave--for 2**N states you need 2**N outputs in order to be able to solve
the linear system.

Bill Sloman

unread,
Oct 18, 2011, 12:03:46 PM10/18/11
to
On Oct 18, 3:48 pm, Phil Hobbs
<pcdhSpamMeSensel...@electrooptical.net> wrote:
> On 10/17/2011 11:08 PM, josephkk wrote:
>
> > On Mon, 17 Oct 2011 00:10:09 -0400, Phil Hobbs
> > <pcdhSpamMeSensel...@electrooptical.net>  wrote:
This doesn't seem to be a sensible approach. My feeling is that the
obvious way to synthesise a staircase approximation to a sine wave is
with roughly equal amplitude steps, not that this saves you that many
steps - the ratio is pi/2 to one. You design for an N-step
approximation to a single quadrant, with N resistors and N SPST
switches plus one SPDT - the extra switch changes the polarity of the
source voltage from 180 dgrees to 360 degrees - and drive the switches
from a programmable logic device which can count up to roughly 2.pi.N
and decodes the counter output to drive the N+1 switches. The
resistors wouldn't be identical, but their resistances won't be wildly
different either.

--
Bill Sloman, Nijmegen

George Herold

unread,
Oct 18, 2011, 12:15:49 PM10/18/11
to
> George H.- Hide quoted text -
>
> - Show quoted text -

Well I stuck a switch cap filter on the output. (LTC1063, I know only
50kHz, which doesn’t ‘meet my spec', but I had one lying around.)

I clocked it at 16 times the stepped sine wave so the 3dB point was
1.6 times the fundamental. Here’s the spectrum before the SC.

http://imageshack.us/photo/my-images/404/sc1s.png/

And after it.
http://imageshack.us/photo/my-images/6/sc2h.png/


The second harmonic goes up more than 10dB! And there is all this
other ‘fluff’ at low frequency. Some new peak stands up at 2.5 kHz.
I moved the 3dB point up to 3.2kHz and the 2nd harmonic was a few dB
better... the weird signal at 2.5kHz moved out to 5 kHz? Not sure I
like switched cap filters. We used the same SC on a different project
and it also added ‘out of band’ curd... at similar levels.

I’ll try an analog multi pole Butterworth. Maybe a Sallen-Key.

George H.

lang...@fonz.dk

unread,
Oct 18, 2011, 1:12:55 PM10/18/11
to
On 17 Okt., 01:09, "k...@att.bizzzzzzzzzzzz" <k...@att.bizzzzzzzzzzzz>
wrote:
I had the crazy idea of using a serial flash, too bad the 45lf010
isn't available anymore
it had a read command 0xff, so you could just tie din high and clock
it and it would spit
out bits forever. you could use a config flash for an fpga but they
are a bit expensive

program the flash with Don Lancasters magic sine waves, or run a
sinewave through a delta-sigma
modulator

-Lasse


Phil Hobbs

unread,
Oct 18, 2011, 2:15:39 PM10/18/11
to
On 10/18/2011 12:15 PM, George Herold wrote:
> On Oct 17, 10:02 am, George Herold<gher...@teachspin.com> wrote:
>> On Oct 16, 11:43 pm, dagmargoodb...@yahoo.com wrote:
>>
>>
>>
>>
>>
>>> On Oct 16, 6:09 pm, "k...@att.bizzzzzzzzzzzz" wrote:
>>
>>>> On Sun, 16 Oct 2011 10:42:48 -0700 (PDT), dagmargoodb...@yahoo.com wrote:
>>>>> On Oct 16, 8:55 am, "k...@att.bizzzzzzzzzzzz" wrote:
>>>>>> On Sun, 16 Oct 2011 06:25:38 -0700 (PDT), dagmargoodb...@yahoo.com wrote:
>>>>>>> So, we've got several versions: 10 steps with one chip, 16 steps with
>>>>>>> three chips, or 32 steps for five chips. Or, as always, you could use
>>>>>>> a PIC :-)
>>
>>>>>> Or an 8-bit counter (e.g. '579), ROM, and DAC. 256 steps, three chips. ;-)
>>
>>>>>> The synchronous counter is the limitation, here.
>>
>>>>> Hey, how about two 'HC4017's, driven out-of-phase. Clock one rising,
>>>>> one falling. That's 20 steps, two chips, dirt-simple.
>>
>>>> An FPGA. Hundreds of steps, one chip. Pick your poison. ;-)
>>
>>> Come to think of it, I suspect staggered 'HC4017's doesn't work. Each
>>> output of "B" would straddle (be active during) two output states of
>>> "A", and the simultaneous equations fail. You'd need to buffer 'em so
>>> you could enable just one 'HC4017 at a time, which is messy& takes
They do that, especially when the input consists of one or a few pure
tones--there's all sorts of intermodulation junk. If you put an RC
lowpass in front of it, you'd reduce the input slew rate, which would
help the IMD. A nice four-pole Chebyshev would do a good job of it, I
should think.

Cheers

Phil Hobbs

whit3rd

unread,
Oct 18, 2011, 11:10:32 PM10/18/11
to

On Monday, October 17, 2011 6:50:40 AM UTC-7, George Herold wrote:

> You can get 0.1% resistors from Sussumu for ~$0.20 each.

Twenty cents each? If they stock values from 100 to 100k ohms,
that means they have to have about 7000 standard values?
Cool!

One zero-ohm resistor, and two (maybe four) of the smallest resistors,
can be 1% values, without undue error. So, there's room to squeeze
the $2 figure down a little.


dagmarg...@yahoo.com

unread,
Oct 18, 2011, 11:49:08 PM10/18/11
to
> And after it.http://imageshack.us/photo/my-images/6/sc2h.png/
>
> The second harmonic goes up more than 10dB!  And there is all this
> other ‘fluff’ at low frequency.  Some new peak stands up at 2.5 kHz.
> I moved the 3dB point up to 3.2kHz and the 2nd harmonic was a few dB
> better... the weird signal at 2.5kHz moved out to 5 kHz?  Not sure I
> like switched cap filters.  We used the same SC on a different project
> and it also added ‘out of band’ curd... at similar levels.
>
> I’ll try an analog multi pole Butterworth.   Maybe a Sallen-Key.
>
> George H.

I've got two articles in the hard drive vault that use a squarewave
into a switched cap filter, overclocked >100:1, to generate a
sinewave. The first architecture is fixed 1kHz:
TLC555 ==> 19kHz RC-lowpass ==> MF6CN100 (Nat'l Semi), claims
harmonics are 60dB down.

The 2nd generates squarewaves with a uC. That drives a 64x
overclocked MAX292 (8th-order Bessel directly). "Clean" sinewave is
all they say. They run the MAX292 bipolar off +5v, using a 10k-10k
divider for a virtual rail. Funky.

I could e-mail you the articles if interested, but they _really_ don't
say much more than what I already wrote.

1) Simple circuit generates clean sine waves, EDN, June 19, 1997, pg.
99
2) Microcontroller-based Sine Wave Generator Has Crystal Accuracy,
Electronic Design, Dec. 14, 1998, pg. 74


--
Cheers,
James Arthur

Bill Sloman

unread,
Oct 19, 2011, 6:27:07 AM10/19/11
to
On Oct 19, 5:10 am, whit3rd <whit...@gmail.com> wrote:
> On Monday, October 17, 2011 6:50:40 AM UTC-7, George Herold wrote:
> > You can get 0.1% resistors from Sussumu for ~$0.20 each.
>
> Twenty cents each?  If they stock values from 100 to 100k ohms,
> that means they have to have about 7000 standard values?

Most probably they will only stock the E96 grid, which is 3x96 values,
188 rather than 7,000.

There is an E192 grid, but I don't know anybody who stocks anything
like a full range on that grid

<snip>

--
Bill Sloman, Nijmegen

dagmarg...@yahoo.com

unread,
Oct 19, 2011, 9:29:24 AM10/19/11
to
On Oct 16, 11:10 pm, Phil Hobbs
<pcdhSpamMeSensel...@electrooptical.net> wrote:
> On 10/16/2011 11:43 PM, dagmargoodb...@yahoo.com wrote:

> > Come to think of it, I suspect staggered 'HC4017's doesn't work.  Each
> > output of "B" would straddle (be active during) two output states of
> > "A", and the simultaneous equations fail.  You'd need to buffer 'em so
> > you could enable just one 'HC4017 at a time, which is messy&  takes
> > more chips.
>
> > So, it's either one 'HC4017, or a PIC.  (Or a 555, details left as an
> > exercise for the student.)
>
>
> We really need a 4017 with tri-state outputs. ;)
>
> You could take advantage of the particular phase choice that George
> used, i.e. one phase is disconnected, and use a bunch of SIPO shift
> registers.  Do a synchronous reset of all of them when the last stage
> goes high, and use an R-S flipflop to inject a 1 into the first stage
> when that happens, reset from the output of the first stage.
>
> It would also need a missing pulse detector or something like that to
> make sure that it doesn't just sit there producing all zeros forever.
> You could get 8N+1 phases for about N+2 packages and 8N resistors.

Not bad--that's pretty simple.

> Alternatively, adapting your folding trick, it might be possible to use
> a bunch of universal shift registers and just shuttle the 1-state back
> and forth from end to end, by changing the shift direction when it hits
> the end.  That way you'd get 16N or maybe 16N-1 codes for N + 3ish
> packages and 8N resistors.
>
> Fun.

I poked around the available shift registers @ Digikey. Alas, bi-
directionals are 4 bits only.

So, my best low chip stepped addition(s) are these:
74HC154
.------.
| 0|---[R0]--.
| 1|---[R1]--+
| 2|---[R2]--+
| 3|---[R3]--+
| 4|---[R4]--+ .------.
| 5|---[R5]--+ | X |
| 6|---[R6]--+-->|+/- 1 |--> to filter
| 7|---[R7]--+ | |
| 8|---[R8]--+ '------'
| 9|---[R9]--+ ^
| 10|--[R10]--+ |
| 11|--[R11]--+ |
| 12|--[R12]--+ |
| 13|--[R13]--+ |
| 14|--[R14]--+ |
| 15|--[R15]--' |
| | |
| ABCD | |
'------' |
|||| |
.----. |
|XOR |<-. |
'----' | |
|||| .-' |
|||| |.---------------'
|||| ||
.---------.
| ABCD EF |
64x clk -|> | 6-bit Counter
| |
'---------'

You could go to 32 steps by dropping the +/-1 stage and save a chip,
naturally.


Or you can extend an 8-step DAC to get a 32-step sine, as suggested
before...

'HC4051
.-----.
v7-----|0 |
v6-----|1 | .-------.
v5-----|2 | | X |
v4-----|3 Y|----| +/- 1 |---
v3-----|4 | | |
v2-----|5 | '-------'
v1-----|6 | ^
v0-----|7 | |
| ABC | |
'-----' |
||| |
.---. |
|XOR|<-. |
'---' | |
||| .-' |
||| |.-------'
||| ||
.-------.
| ABC DE|
32x clk -|> | 5-bit Counter
| |
'-------'

The neat thing about these sine-weighted DACs over straight linear
DACs is that, theoretically, the steps can be exact. 0.1% resistors
puts you competitive with 10-bit linear DACs, with a lot less hassle.

--
Cheers,
James Arthur

George Herold

unread,
Oct 19, 2011, 9:39:57 AM10/19/11
to
Ahh, they only have the 'standard' 1% values. Here's 10k ones in 0805
package.
http://search.digikey.com/us/en/products/RG2012P-103-B-T5/RG20P10.0KBCT-ND/1241041

To get the exact values to 0.1% I'll have to mix some 0.1% resistors
with smaller 1%ers.

If you can use one thousand of 'em then they're only ~$0.1 each.
Pretty amamzing really, you can make amps with a gain of
10.00(something)

George H.

dagmarg...@yahoo.com

unread,
Oct 19, 2011, 10:05:34 AM10/19/11
to
> And after it.http://imageshack.us/photo/my-images/6/sc2h.png/
>
> The second harmonic goes up more than 10dB!  And there is all this
> other ‘fluff’ at low frequency.  Some new peak stands up at 2.5 kHz.
> I moved the 3dB point up to 3.2kHz and the 2nd harmonic was a few dB
> better... the weird signal at 2.5kHz moved out to 5 kHz?  Not sure I
> like switched cap filters.  We used the same SC on a different project
> and it also added ‘out of band’ curd... at similar levels.
>
> I’ll try an analog multi pole Butterworth.   Maybe a Sallen-Key.
>
> George H.

Ideas: I'd suggest you aren't clocking the LIC1063 fast enough, and
need a small anti-aliasing pre-filter. (Doesn't it need 100x anyhow?)

Choosing the filter clock frequency as some integer multiple of the
DAC clock rate will kill most of the intermodulation products.

--
Cheers,
James Arthur

dagmarg...@yahoo.com

unread,
Oct 19, 2011, 10:07:54 AM10/19/11
to
On Oct 18, 12:12 pm, "langw...@fonz.dk" <langw...@fonz.dk> wrote:


> I had the crazy idea of using a serial flash, too bad the 45lf010
> isn't available anymore
> it had a read command 0xff, so you could just tie din high and clock
> it and it would spit
> out bits forever. you could use a config flash for an fpga but they
> are a bit expensive
>
> program the flash with Don Lancasters magic sine waves, or run a
> sinewave through a delta-sigma
> modulator
>
> -Lasse

That's good idea, really. That's the ultimate self-clocking shift-
register.

--
Cheers,
James Arthur

k...@att.bizzzzzzzzzzzz

unread,
Oct 19, 2011, 10:44:02 AM10/19/11
to
If you can deal with 25ppm/C, DigiKey has them by the reel for under $.04
each.

George Herold

unread,
Oct 19, 2011, 11:20:58 AM10/19/11
to
> James Arthur- Hide quoted text -
>
> - Show quoted text -

Gee thanks, but please don't bother. I'm now looking for a VCO to
drive the whole chain. I was going to try the VCO in one of the 4046
PLL chips.. they are cheap enough. But I also found this
'synchronous' V-F converter. AD7741 it comes in an DIP which is
nice.

George H.

dagmarg...@yahoo.com

unread,
Oct 19, 2011, 11:47:04 AM10/19/11
to
> Gee thanks, but please don't bother.  I'm now looking for a VCO to
> drive the whole chain.  I was going to try the VCO in one of the 4046
> PLL chips.. they are cheap enough.  But I also found this
> 'synchronous' V-F converter.  AD7741  it comes in an DIP which is
> nice.
>
> George H.

Don't worry about all the chit-chat--none of it obligates you, we're
just playing. You're already on a pretty good path.

--
Cheers,
James Arthur

Phil Hobbs

unread,
Oct 19, 2011, 12:54:33 PM10/19/11
to
Agreed about the little RC DACs--they're cute. There's an old arbitrary
waveform generator, the Exact 202, that has an array of 10-turn panel
pots, one for each point in the waveform I wonder if they used this
trick or had a bunch of analogue switches?

There's the 74HC299, which is an 8-bit universal shift register, and
among its other talents it can shift both directions. That plus an
HC74 dual D flipflop will make it do the back and forth one-shuttling
trick. One half of the HC74 is an RS flipflop that switches the
shifting direction--set on Q8 of the right-hand end (an auxiliary
FF--see below), reset on Q0 of the left-hand end.

Getting rid of spurious sequences is always the trick with this sort of
gizmo. Clocking the 1 off one the end of the register into the other
half of the HC74 makes this easy--connect its Q output to the
appropriate serial input, AC couple its Qbar output into the Rbar
(master reset) inputs of the shift registers, and use a mickey-mouse
logic one-shot on its S' input, so that it sets itself asynchronously if
it doesn't see a one-state every so often. (Diode from Q to Sbar, RC
from Sbar to ground.)

If RC-coupling logic is too gross, we could use an HC123 dual one-shot
package. (It's also possible to use gates to form the reset and do the
RC-coupling thing on the gate package to make a missing pulse detector.

So assuming I haven't missed anything too horrible, using symmetry, you
can make a 16N+1 step sine wave with N shift registers, one D flipflop
package, and a bit of M2L or a one-shot. If an even-order approximation
is important, we could take the DFF's input one stage early and get 16N
instead.

Cheers

Phil Hobbs

(Who has wasted too much time on this exercise, but enjoyed it.)




George Herold

unread,
Oct 19, 2011, 1:25:10 PM10/19/11
to
> James Arthur- Hide quoted text -
>
> - Show quoted text -

Big Grin! No it's my great pleasure! Some one sent me "two tramps in
mud time" yesterday.

http://www.etymonline.com/poems/tramps.htm

The last few lines keep tripping through my head.
(My 'excuse' for doing electronics.)

George H.

George Herold

unread,
Oct 19, 2011, 11:47:07 AM10/19/11
to
SC clocked at 160kHz (1.6kHz corner), stepped sine clocked at 10kHz,
output at 1kHz. Clocking the SC faster helped a bit...
>
> Choosing the filter clock frequency as some integer multiple of the
> DAC clock rate will kill most of the intermodulation products.

I am clocking everthing from the same source.

I mumble, "inter modulation distortion". But I really don't know
what that means.
(OK, sure freq. X mixes with freq. Y and you get a little sum and/or
difference at the output. But how does it happen?)
I was wondering if I choose some prime number divider if that would
help? Run the SC at say 17 times the clock to the stepped sine.

I'll see what a little pre-filtering does.

George H.
>
> --
> Cheers,
> James Arthur- Hide quoted text -

dagmarg...@yahoo.com

unread,
Oct 19, 2011, 3:22:24 PM10/19/11
to
I thought the LTC1063 needs a 100x clock (f_cutoff = f_clk/100)? So,
for a 1KHz output, the 4017 should be clocked at 10Khz, and the filter
at 1MHz. No, wait, 100kHz--my mistake.

That's only 10x the DAC clock rate. Hmmm. Kind of tight.


> > Choosing the filter clock frequency as some integer multiple of the
> > DAC clock rate will kill most of the intermodulation products.
>
> I am clocking everthing from the same source.

Good. (I think.)

>  I mumble, "inter modulation distortion".  But I really don't know
> what that means.
> (OK, sure freq. X mixes with freq. Y and you get a little sum and/or
> difference at the output. But how does it happen?)

All this chopping and sampling produces mixing products. So, for
example, the 9th and 11th harmonics get mixed, producing 2nd and 20th
harmonics. The combinations are infinite.


> I was wondering if I choose some prime number divider if that would
> help?  Run the SC at say 17 times the clock to the stepped sine.

You could spread them out with spread spectrum techniques (modulate
the filter clock), but I'm not sure that helps...depends who's
generating how much of what.

> I'll see what a little pre-filtering does.

Should cut down on lots of high-order mixing products. It's cheap--
worth doing.

--
Cheers,
James Arthur

dagmarg...@yahoo.com

unread,
Oct 19, 2011, 4:34:48 PM10/19/11
to
Whose poem this is I think I know,
he's nowhere near to see me though;
he will not see me reading here
his dusty works by monitor's glow...

Very appropriate. Lumberjacking has been heavy on my mind, with an
eye to a neighbor's ancient mighty oak, felled by tropical storm Lee.
A heavy, heavy timber atop the carport it crushed, in need of cutting,
hauling, and splitting. Firewood and warmth for years. I've been
jammed up, soon to be free, and alas, someone beat me to it yesterday,
probably for pay. Shucks.

--
Cheers,
James Arthur

George Herold

unread,
Oct 19, 2011, 10:25:46 PM10/19/11
to
Ahh, well that was exactly why it was sent to me. Unlike Robert F. I
do all my wood splitting in the autumn. I've got a lot of dead and
dying Ash in my woods, which splits with a 'snap'. (hydraulically*)
And then some big ole dead Elm, which is just about the stringiest,
nastiest wood I know. Once they are mostly split with the machine, I
still sometimes have to get out the axe to finish the job. I should
finish my pile this weekend, then I just have to stack it. The
'problem' with wood is you have to move it three (or more) times
before it ends up in the stove.

George H.

*Once you use hydraulics you're ruined for life.


And thanks for the poem.

josephkk

unread,
Oct 19, 2011, 11:00:06 PM10/19/11
to
For something like this i might try to use inverse Chebychev and drop the
out of band notches on top of the harmonics. Probably cannot hit the
second harmonic though.

?-)

John S

unread,
Oct 20, 2011, 12:50:02 PM10/20/11
to
On 10/19/2011 9:25 PM, George Herold wrote:
>The
> 'problem' with wood is you have to move it three (or more) times
> before it ends up in the stove.

OTOH, it warms you more than once.

whit3rd

unread,
Oct 21, 2011, 12:11:42 AM10/21/11
to
On Wednesday, October 19, 2011 6:39:57 AM UTC-7, George Herold wrote:

> > > You can get 0.1% resistors from Sussumu for ~$0.20 each.

> Ahh, they only have the 'standard' 1% values.

Drat. I had visions of a bin for each value, 100 ohms to 100k, at
0.1% increments; 4 x 4 inch bins, up from the floor to about five
feet, spread out 154 feet, in the back of every Radio Shack.

Benj

unread,
Oct 21, 2011, 3:04:21 AM10/21/11
to
On Oct 13, 7:54 pm, Jon Kirwan <j...@infinitefactors.org> wrote:
> On Thu, 13 Oct 2011 16:08:49 -0700, Jim Thompson
>
>
>
>
>
>
>
>
>
> <To-Email-Use-The-Envelope-I...@On-My-Web-Site.com> wrote:
> >On Thu, 13 Oct 2011 10:24:17 -0700, Jon Kirwan
> ><j...@infinitefactors.org> wrote:
>
> >>On Thu, 13 Oct 2011 10:13:20 -0700 (PDT), George Herold
> >><gher...@teachspin.com> wrote:
>
> >>>On Oct 13, 12:59 pm, Jon Kirwan <j...@infinitefactors.org> wrote:
> >>>> On Thu, 13 Oct 2011 09:39:21 -0700 (PDT), George Herold
>
> >>>> <gher...@teachspin.com> wrote:
> >>>> >This is a continuation of the 50kHz VCO thread I started last week. I
> >>>> >tried the stepped sine wave idea as suggested by James A, and Phil
> >>>> >H.
> >>>> >The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at
> >>>> >frequency (F). The ten outputs from the 4017 are sent through
> >>>> >appropriate resistors and into the summing junction of an opamp.
> >>>> >Here s a scope shot of the stepped output overlaid with a sine
> >>>> >wave.
>
> >>>> >http://imageshack.us/photo/my-images/560/tek0024.png/
>
> >>>> >The resistor values were chosen to intersect the sine wave at each new
> >>>> >phase. (R(n) = 1/sin^2(n*18degrees))
>
> >>>> >Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k,
> >>>> >R4=R6=11k, R5=10k. all 1% resistors.
>
> >>>> >Here s the spectrum as recorded by an SRS770 spectrum analyzer.
>
> >>>> >http://imageshack.us/photo/my-images/839/stepsin.png/
>
> >>>> >The 2nd harmonic is only down by 50dB. I don t understand why it s so
> >>>> >big. Is there some way to do better than this? The 9th and 11th
> >>>> >harmonics are big and then the 19th and 21st.
>
> >>>> >Thanks George H.
>
> >>>> George, I don't remember the discussion. Probably didn't
> >>>> read it. But if you are using a 4017 (decade counter), then
> >>>> I'm guessing that you are enabling one resistor at a time
> >>>> while disabling others (they tie to the summing junction from
> >>>> each, moving output pin.) This worries me a little, mostly
> >>>> because of delay and the fact that you are turning off one
> >>>> while turning on another, but don't control that very well. I
> >>>> also don't know what you are doing to filter the steps.
>
> >>>> Anyway, I'd have wanted to consider, instead, a Gray-coded
> >>>> (actually, the real inventor is Boudot, I think, but Bell
> >>>> Labs was patenting everything in a flurry in the mid 1900's
> >>>> and who could remember Boudot so long ago?) design where you
> >>>> only change one of the outputs at a time. Not two.
>
> >>>> Anyway, I'll let the big hitters who probably did read the
> >>>> earlier thread tell you what is more likely. Just something
> >>>> that crossed my mind, is all.
>
> >>>> Jon- Hide quoted text -
>
> >>>> - Show quoted text -
>
> >>>Hi Jon,  Thanks for that.
>
> >>No problem.  In the interim, I did a quick search for summing
> >>junctions and Gray codes and came up with this link:
>
> >>http://www.wiseguysynth.com/larry/schematics/walsh/walsh.pdf
>
> >I posted this 8 years ago...
>
> >http://www.analog-innovations.com/SED/SineEqualsSumOfSquares.pdf
>
> >I also have this book...
>
> >"Sequency Theory, Foundations and Applications"
> >Henning F. Harmuth
> >Academic Press, 1977
> >ISBN: 0-12-014569-3
>
> >which covers Walsh Functions in gruesome detail ;-)
>
> I picke up Walsh's original paper (redone, actually, in Latex
> and error corrected as it had a few in the original article)
> from the web, today.  The paper is "A Closed Set of Normal
> Orthogonal Functions."  I will be reading it more thoroughly
> over the next couple of days.  Also, already listed the above
> link which is a nice, short overview with two examples in it.
> Finally, there are a bevy of books (some of them nearly 1300
> pages in length) on the subject regarding making and building
> synthesizers.  I'll be ordering a few before the end of the
> week.
>
> A whole world has opened up on this subject for me and I can
> bring over Laplace and Fourier.  Actually, it is almost easy
> for me to see how to apply this with almost any starting wave
> shape, not just sine/cosine or square wave.  Which probably
> isn't terribly practical, but interesting all the same. (Must
> be some mathematician out there has already explored the use
> of triangle, sawtooth, and pretty much any arbitrary basic
> shape.)
>
> I will read your PDF, as well.  :)
>
> Jon

I was going to suggest using Walsh functions. They make great
sinewaves (or ANY repetitive waveshape, although there is a problem
with the "peak" on triangles). The difference between Walsh function
generation and typical D-A converters is that Walsh functions
distribute the switching over the period and don't need a resistive
ladder where some elements need high accuracy.

Read the pdf. and it should explain how to reproduce any waveform. You
just need to get the transform of the waveform that lists coefficient
of each Walsh function. The beauty of this method is the often many of
them are zero and hence do not need to be implemented. Typically the
spectrum is very low in the lower harmonics rising much higher in high
harmonics where the "stairsteps" start to produce spectrum. Obviously
the more steps you use the further out is that rise.

I didn't see the original thread so I don't know what your application
is.

Jon Kirwan

unread,
Oct 21, 2011, 5:59:06 AM10/21/11
to
My intuition suggested changing only one digital output at a
time -- which is why I gravitated towards Gray coding.
Searching on that led me to Walsh, which seemed right on the
money. But I still haven't had time to read about them. I
did just receive my beautiful copy of Harmuth's "Sequency
Theory" book, though. And glad to have it. And it does go
directly into Gray code ordering of Walsh functions, so I'm
happy now.

>Read the pdf. and it should explain how to reproduce any waveform. You
>just need to get the transform of the waveform that lists coefficient
>of each Walsh function. The beauty of this method is the often many of
>them are zero and hence do not need to be implemented.

On the short PDF, I clearly got this message. (odd and even
functions, etc.)

>Typically the
>spectrum is very low in the lower harmonics rising much higher in high
>harmonics where the "stairsteps" start to produce spectrum. Obviously
>the more steps you use the further out is that rise.

Got it.

>I didn't see the original thread so I don't know what your application
>is.

It's not my application, but George's. He's using a 4017
(decade decoder thing) right now (or was) and ties in
resistors on each of the 10 pins to a summing point of an
opamp in order to make a stepped sine wave. But he didn't
like the spectrum he got, especially the 2nd harmonic.

I hadn't done this, but my gut told me that the 4017 was
changing two resistors nearly at once (but perhaps not
exactly so) and with ripple carry and all I wasn't
comfortable and wanted to suggest thinking in terms of a gray
coded approach. Which is what led me to Walsh, which I'd not
heard of before but wish I had.

Jon

Michael A. Terrell

unread,
Oct 21, 2011, 6:05:42 AM10/21/11
to
You mean 154 feet of empty bins?


--
You can't have a sense of humor, if you have no sense.

Bill Sloman

unread,
Oct 21, 2011, 11:02:39 AM10/21/11
to
The 4017 is a twisted ring shift-register-based Johnson counter -
whence no ripple carry within the counter, though it does have a
ripple carry output.

http://www.national.com/ds/CD/CD4017BC.pdf

The second harmonic content was almost certainly due to the tolerances
on his resistors - P-channel on-resistance is higher than N-channel in
most CMOS logic, but in modern parts the channel resistance is too low
to have explained the second harmonic content he saw.

Jon Kirwan

unread,
Oct 21, 2011, 2:27:42 PM10/21/11
to
Thanks, Bill, for the correction on that point.

>The second harmonic content was almost certainly due to the tolerances
>on his resistors - P-channel on-resistance is higher than N-channel in
>most CMOS logic, but in modern parts the channel resistance is too low
>to have explained the second harmonic content he saw.

I was explaining my early reasoning for commenting at all,
which as you point out isn't the explanation. I've learned
that much as I've been reading here. So that's been good for
me. However, I remain very happy to have learned a few
things about gray code ordered Walsh functions, too.

Anyway, thanks for the summary and correction. It helps.

Jon

George Herold

unread,
Oct 21, 2011, 9:15:53 PM10/21/11
to
> Bill Sloman, Nijmegen- Hide quoted text -
>
> - Show quoted text -

Hi Bill, did you read the rest of the thread? I measrured an output
impedance of ~180 omhs (at 15V) for the 1MC4017 I was using. That's
about 2% of the smallest resistor (10k ohm). Bigger than the 1%
resistor tolerance, and certianly the major cause of the 2nd harmonic
distortion in my first circuit.

George H.
(I hope you can forgive the slight correction, I didn't want the
thread to end with a mis-statement)

George Herold

unread,
Oct 21, 2011, 9:35:55 PM10/21/11
to
> thread to end with a mis-statement)- Hide quoted text -
>
> - Show quoted text -

So here's a late Friday night question, (after a few Genny's). If I
used a bipolar output (switching the sign at zero with an opamp, and
picking new resistors), would the distortion caused by the output
impedance move from the 2nd harmonic to the third? Squishing both
sides equally rather than just pushing the top down.

I find it hard moving from distortion in the time demain to the
frequency domain.

George H.

The Phantom

unread,
Oct 21, 2011, 10:57:00 PM10/21/11
to
On Thu, 13 Oct 2011 09:39:21 -0700 (PDT), George Herold <ghe...@teachspin.com>
wrote:

>This is a continuation of the 50kHz VCO thread I started last week. I
>tried the stepped sine wave idea as suggested by James A, and Phil
>H.
>The circuit clocks a MC14017 at 10x(F) to make a stepped sine wave at
>frequency (F). The ten outputs from the 4017 are sent through
>appropriate resistors and into the summing junction of an opamp.
>Here’s a ‘scope shot of the stepped output overlaid with a sine
>wave.
>
>http://imageshack.us/photo/my-images/560/tek0024.png/
>
>The resistor values were chosen to intersect the sine wave at each new
>phase. (R(n) = 1/sin^2(n*18degrees))
>
>Approximate values, R0=open, R1=R9=105k, R2=R8=28.9k, R3=R7=15.3k,
>R4=R6=11k, R5=10k. all 1% resistors.
>
>
>Here’s the spectrum as recorded by an SRS770 spectrum analyzer.
>
>http://imageshack.us/photo/my-images/839/stepsin.png/
>
>The 2nd harmonic is only down by 50dB. I don’t understand why it’s so
>big. Is there some way to do better than this? The 9th and 11th
>harmonics are big and then the 19th and 21st.
>
>Thanks George H.

On March 30, 2006, Tim Shoppa started a thread in this newsgroup that has some
relevance to this. It should be easy to find at Google.

Bill Sloman

unread,
Oct 22, 2011, 5:13:44 PM10/22/11
to
On Oct 22, 3:15 am, George Herold <gher...@teachspin.com> wrote:
> >BillSloman, Nijmegen- Hide quoted text -
>
> > - Show quoted text -
>
> HiBill, did you read the rest of the thread?  I measured an output
> impedance of ~180 omhs (at 15V) for the 1MC4017 I was using.  That's
> about 2% of the smallest resistor (10k ohm).  Bigger than the 1%
> resistor tolerance, and certianly the major cause of the 2nd harmonic
> distortion in my first circuit.
>
> George H.
> (I hope you can forgive the slight correction, I didn't want the
> thread to end with a mis-statement)

Forgive it? I'm grateful for it. I knew I should have checked before I
posted that comment, but succumbed to the temptation to wing it.

I am a bit surprised that you had an MC4017 to play with. I know that
they are still commercially available, but it's difficult to imagine
any good reason for using them, unless you are hopelessly addicted to
+/-15V power rails.

When I put together a similar circuit in the late 1970's (to make
pseudo-random noise to confuse echo-locating bats) I got worried
enough about the CD/MC output impedances to use 4066's to do the
switching, but I still had to redo the resistors after I found out
about Gibb's oscillation the hard way and had to aply a Hamming raised-
cosine window to almost every one of 32 carefully trimmed resistances.

--
Bill Sloman, Nijmegen

Phil Hobbs

unread,
Oct 22, 2011, 9:08:47 PM10/22/11
to
If the resulting waveform has inversion symmetry, i.e. if for all t

f(t) + f(t+T/2) = 0,

then it can't have any even harmonics.

Cheers

Phil Hobbs

--
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC
Optics, Electro-optics, Photonics, Analog Electronics

160 North State Road #203
Briarcliff Manor NY 10510
845-480-2058

hobbs at electrooptical dot net
http://electrooptical.net
0 new messages